//
//  SearchRankController.h
//  Cabinet
//
//  Created by Florent Montsegur on 23/08/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "Rang.h"

@interface SearchRankController : NSWindowController<NSTableViewDataSource>{
@private
    NSMutableArray *mRanks;
    NSTableView *__unsafe_unretained mRanksView;

    NSManagedObjectContext * mManagedObjectContext;

    NSInteger mSelectedIndex;
    int mResult;
}

@property (nonatomic, strong) NSManagedObjectContext * mManagedObjectContext;
@property (unsafe_unretained) IBOutlet NSTableView *mRanksView;

// NSTableViewDataSource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;

- (NSInteger) count;

- (IBAction)okAction:sender;
- (IBAction)annulerAction:sender;

- (void) closeWindow;
- (void) withParentWindow:parentWindow;
- (int) returnCode;
- (void) setRanks:(NSArray*)aRanksList;


- (Rang*)getRankAtIndex:(NSInteger)aRowIndex;
- (Rang*)selectedRank;

- (IBAction)supprimerAction:sender;

@end